{include file="public/layout"/}
<body class="bodystyle" style="min-width:auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-10" style="min-width:auto; ">
    <div class="flexigrid htitx">
        <div class="hDiv" id="notify_list">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                        <tr>
                            <th class="sign w10" axis="col0">
                                <div class="tc"></div>
                            </th>
                            <th abbr="article_title" axis="col3" class="w10">
                                <div id="anchor-sms" class="tc">登录锁定</div>
                            </th>
                            <th abbr="ac_id" axis="col4">
                                <div class="pr10 tr"><i class="arrow iconfont e-up curpoin"></i></i></div>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
        <form class="form-horizontal" id="handlepost1" method="post" enctype="multipart/form-data" action="{:url('Security/popup_flameproof')}">
            <div class="ncap-form-default">
                <dl class="row">
                    <dt class="tit">
                        <label for="web_login_lockopen">登录失败锁定</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin mr10"><input id="web_login_lockopen1" name="web_login_lockopen" onclick="login_lockopen(this);" value="1" type="radio" {if condition="!isset($global.web_login_lockopen) || $global.web_login_lockopen == 1"} checked="checked"{/if}>开启</label>
                        &nbsp;
                        <label class="curpoin mr10"><input id="web_login_lockopen0" name="web_login_lockopen" onclick="login_lockopen(this);" value="0" type="radio" {if condition="isset($global.web_login_lockopen) && $global.web_login_lockopen == 0"} checked="checked"{/if}>关闭</label>
                        <span class="err"></span>
                        <p class="notic">登录多次失败后，账号将被锁定一定时长</p>
                    </dd>
                </dl>
                <div id="div_login_lock" class="{if condition='isset($global.web_login_lockopen) && $global.web_login_lockopen == 0'}none{/if}">
                    <dl class="row">
                        <dt class="tit">
                            <label for="web_login_errtotal">登录错误次数</label>
                        </dt>
                        <dd class="opt">
                            <input id="web_login_errtotal" name="web_login_errtotal" value="{$global.web_login_errtotal|default=config('login_errtotal')}" class="input-txt" type="text" placeholder="不启用默认留空" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')" />&nbsp;次
                            <p class="notic"></p>
                        </dd>
                    </dl>
                    <dl class="row">
                        <dt class="tit">
                            <label for="web_login_errexpire">登录锁定时间</label>
                        </dt>
                        <dd class="opt">
                            <input id="web_login_errexpire" name="web_login_errexpire" value="{$global.web_login_errexpire|default=config('login_errexpire')}" class="input-txt" type="text" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')" />&nbsp;秒
                            <p class="notic">默认600秒等于10分钟</p>
                        </dd>
                    </dl>
                </div>
                <dl class="row">
                    <div class="bot" style="padding-bottom:0px;">
                        <a href="JavaScript:void(0);" onclick="checkForm1();" class="ncap-btn-big ncap-btn-green">保存</a>
                    </div>
                </dl>
            </div>
        </form>
    </div>
    <!-- <div class="flexigrid htitx">
        <div class="hDiv" id="notify_list">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                        <tr>
                            <th class="sign w10" axis="col0">
                                <div class="tc"></div>
                            </th>
                            <th abbr="article_title" axis="col3" class="w10">
                                <div id="anchor-sms" class="tc">后台防火墙</div>
                            </th>
                            <th abbr="ac_id" axis="col4">
                                <div class="pr10 tr"><i class="arrow iconfont e-up curpoin"></i></i></div>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
        <form class="form-horizontal" id="post_form" action="{:weapp_url('Safe/Safe/index')}" method="post">
            <div class="ncap-form-default">
                <dl class="row">
                    <dt class="tit">
                        <label>后台防火墙</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="1" type="radio" checked="checked">开启</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="0" type="radio" >关闭</label>
                        <span class="err"></span>
                        <p class="notic">登录多次失败后，账号将被锁定一定时长</p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label>所属IP段</label>
                    </dt>
                    <dd class="opt">
                        {$ipSegment}（ 当前IP地址：{$currentIp} ）
                        <span class="err"></span>
                        <p class="notic"></p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label for="ip_whitelist">IP段白名单</label>
                    </dt>
                    <dd class="opt">
                        <textarea rows="5" cols="80" id="ip_whitelist" name="ip_whitelist" style="height:80px;" placeholder="为空默认不限制，IP段示例如下：
127.0.0.1
192.168.1.2
192.168.0.1-192.168.0.255">{$row.ip_whitelist|default=''}</textarea>
                        <p class="">多个设置用回车换行，一行代表一个IP白名单解除限制。<br/>示例（如果是单个IP单独写；如果是IP段用“-”连接最小和最大IP（192.168.0.1-192.168.255.255）</p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label>允许登录的星期</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">星期一</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="2" type="checkbox" checked="checked">星期二</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="3" type="checkbox" checked="checked">星期三</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="4" type="checkbox" checked="checked">星期四</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="5" type="checkbox" checked="checked">星期五</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="6" type="checkbox" checked="checked">星期六</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="7" type="checkbox" checked="checked">星期天</label>
                        <span class="err"></span>
                        <p class="notic"></p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label>允许登录的时间</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">0点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">1点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">2点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">3点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">4点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">5点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">6点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">7点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">8点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">9点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">10点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">11点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">12点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">13点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">14点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">15点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">16点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">17点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">18点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">19点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">20点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">21点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">22点</label>
                        <label class="curpoin blocki w50 mr10"><input id="" name="" onclick="(this);" value="1" type="checkbox" checked="checked">23点</label>
                        <span class="err"></span>
                        <p class="notic"></p>
                    </dd>
                </dl>
                <div class="bot">
                    <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">保存</a>
                </div>
            </div>
        </form>
    </div>
    <div class="flexigrid htitx">
        <div class="hDiv" id="notify_list">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                        <tr>
                            <th class="sign w10" axis="col0">
                                <div class="tc"></div>
                            </th>
                            <th abbr="article_title" axis="col3" class="w10">
                                <div id="anchor-sms" class="tc">双因子</div>
                            </th>
                            <th abbr="ac_id" axis="col4">
                                <div class="pr10 tr"><i class="arrow iconfont e-up curpoin"></i></i></div>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
        <form class="form-horizontal" id="post_form" action="{:weapp_url('Safe/Safe/index')}" method="post">
            <div class="ncap-form-default">
                <dl class="row">
                    <dt class="tit">
                        <label>双因子验证</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="1" type="radio" checked="checked">开启</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="0" type="radio" >关闭</label>
                        <span class="err"></span>
                        <p class="notic">登录多次失败后，账号将被锁定一定时长</p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label>验证类型</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="1" type="radio" checked="checked">邮箱邮件</label>
                        <label class="curpoin mr10"><input id="" name="" onclick="(this);" value="0" type="radio" {>手机短信</label>
                        <span class="err"></span>
                        <p class="notic">账号密码登录后，跳到下一步邮箱/短信的再次验证才进入后台</p>
                        <p class="notic2 red">请完善电子邮箱配置，功能入口基本信息>接口API>电子邮箱</p>
                        <p class="notic2 red">请完善云短信配置，功能入口基本信息>接口API>云短信</p>
                    </dd>
                </dl>
                <div class="bot">
                    <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">保存</a>
                </div>
            </div>
        </form>
    </div> -->
</div>

<script type="text/javascript">
    $(document).ready(function(){
        /* 滑动/展开 */
        $("div.flexigrid .hDivBox").click(function(){
            var arrow = $(this).find("i.arrow");
            if(arrow.hasClass("e-up")){
                arrow.removeClass("e-up");
                arrow.addClass("e-down");
            }else if(arrow.hasClass("e-down")){
                arrow.removeClass("e-down");
                arrow.addClass("e-up");
            }
            $(this).parent().parent().find("div.ncap-form-default").slideToggle();
        });
    });

    function login_lockopen(obj)
    {
        var is_open = $(obj).val();
        if (1 == is_open) {
            $('#div_login_lock').show();
        } else {
            $('#div_login_lock').hide();
        }
    }

    function checkForm1(){
        if (1 == $('input[name=web_login_lockopen]:checked').val()) {
            var web_login_errtotal_obj = $('input[name=web_login_errtotal]');
            if (web_login_errtotal_obj.val() < 2) {
                showErrorMsg('登录错误次数不能少于2次！');
                web_login_errtotal_obj.focus();
                return false;
            }
            var web_login_errexpire_obj = $('input[name=web_login_errexpire]');
            if (web_login_errexpire_obj.val() < 60) {
                showErrorMsg('登录错误次数不能少于60秒！');
                web_login_errexpire_obj.focus();
                return false;
            }
        }
        layer_loading('正在处理');
        setTimeout(function (){
            $.ajax({
                type : 'post',
                url : "{:url('Security/popup_flameproof', ['_ajax'=>1])}",
                data : $('#handlepost1').serialize(),
                dataType : 'json',
                success : function(res){
                    layer.closeAll();
                    if(res.code == 1){
                        showSuccessMsg(res.msg, 500, function(){
                            window.location.reload();
                        });
                    }else{
                        showErrorMsg(res.msg);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        }, 1);
    }
</script>

{include file="public/footer" /}